package com.hmdp.mapper;

import com.hmdp.entity.Blog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 虎哥
 * @since 2021-12-22
 */
public interface BlogMapper extends BaseMapper<Blog> {

    /* 查询探店笔记的详细信息 */
    @Select("select tb.*, tu.nick_name as name, tu.icon " +
            "from tb_blog as tb " +
            "left join tb_user as tu " +
            "on tb.user_id = tu.id " +
            "where tb.id = #{id}")
    Blog getBlogDetail(long id);

}
